/*
 * Copyright (C) 2015 yixun All Rights Reserved.
 *
 * AreaService.java
 */
package com.yixun.qfbao.api.service;

import com.yixun.qfbao.apidto.*;
import com.yixun.qfbao.apidto.base.CommonResDTO;
import com.yixun.qfbao.apidto.v10dto.FirsthandIntentionRevisitReqDto;
import com.yixun.qfbao.model.ApiFailLog;
import com.yixun.qfbao.model.PartnerInfo;
import com.yixun.qfbao.model.dto.ReportProtectOverDueDto;
import com.yixun.qfbao.model.dto.ReportValidOverDueDto;
import com.yixun.qfbao.xf.model.CustomerPremises;
import com.yixun.qfbao.xf.model.Premises;
import com.yixun.qfbao.xf.model.dto.CustomerPremisesDto;

import java.util.List;
import java.util.Map;

/**
 * [文件名称]<br>
 * CPReportService.java<br>
 * <br>
 * [文件描述]<br>
 *  service interface<br>
 *  客户报备
 * <br>
 * [修改记录]<br>
 * 2017-11-9 10:04:27<br>
 *
 * @author JHSong
 * @version 1.00
 */
public interface ReportCommonService {

	/**
	 * 校验M2手机号
	 * @param projectCodeM2
	 * @param merchantCode
	 * @param customerPhone
	 * @param m2RequestUrl
	 * @return
	 */
	CommonResDTO isExistsInM2(String projectCodeM2, String merchantCode, String customerPhone, String m2RequestUrl);

	/**
	 * 设置报备保护规则时间
	 * @param cpDto
	 * @param reportProtectOverDueDto
	 */
	void setReportProtectOverDueTime(CustomerPremisesDto cpDto, ReportProtectOverDueDto reportProtectOverDueDto);

	/**
	 * 设置报备有效规则时间
	 * @param cpDto
	 * @param reportValidOverDueDto
	 */
	void setReportValidOverDueTime(CustomerPremisesDto cpDto, ReportValidOverDueDto reportValidOverDueDto);

	/**
	 * 添加跟进
	 * @param cpDto
	 * @param followType
	 * @param reportPrefix
	 * @param staffId
	 * @param remark
	 */
	void addReportFollow(CustomerPremisesDto cpDto, String followType, String reportPrefix, String staffId, String remark);

	/**
	 * 发送短信
	 * @param premises
	 * @param assistantPi
	 * @param smsMap
	 * @param cpDto
	 * @param remark
	 */
	void sendReportSms(Premises premises, PartnerInfo assistantPi, Map<String, String> smsMap, CustomerPremisesDto cpDto, String remark);

	/**
	 * 添加审核跟进
	 * @param pi
	 * @param customerPremisesId
	 * @param statusMap
	 * @param disableType
	 * @param operFollowRemark
	 * @param affixList
	 * @param optType
	 */
	void setAuditFollow(PartnerInfo pi, Long customerPremisesId, Map<String, String> statusMap, String disableType, String operFollowRemark, List<AffixDto> affixList, String optType);

	/**
	 * 发送审核已到访短信
	 * @param assistantPi
	 * @param customerPremises
	 */
	void sendAuditCPSms(PartnerInfo assistantPi, CustomerPremises customerPremises);

	/**
	 * 推送报备至M2
	 * @param customerPremises
	 * @param m2Url
	 */
	void customerToM2(CustomerPremises customerPremises, String m2Url,String merchantCode);

	/**
	 * 重新推送请求失败的信息至M2
	 * @param apiFailLog
	 * @return
	 */
	int customerToM2Again(ApiFailLog apiFailLog);

	/**
	 * 推送审核微信消息
	 * @param customerPremises
	 * @param statusMap
	 * @param wxMsgCommonDto
	 * @param agToken
	 * @param asToken
	 */
	void sendAuditWxMsg(CustomerPremises customerPremises, Map<String, String> statusMap, WxMsgCommonDto wxMsgCommonDto, String agToken, String asToken);

	/**
	 * 推送交易变更微信消息
	 * @param customerPremises
	 * @param statusMap
	 * @param wxMsgCommonDto
	 * @param agToken
	 * @param asToken
	 */
	void sendConfirmWxMsg(CustomerPremises customerPremises, Map<String, String> statusMap, WxMsgCommonDto wxMsgCommonDto, String agToken, String asToken);

	/**
	 * 同步报备状态至V10
	 * @param optType
	 * @param toV10Dto
	 * @param statusMap
	 * @param affixList
	 */
	void syncReportStatusToV10(String optType, SyncReportStatusToV10Dto toV10Dto, Map<String, String> statusMap, List<AffixDto> affixList);

	/**
	 * 推送重置状态至V10
	 * @param optType
	 * @param toV10Dto
	 * @param statusMap
	 * @param affixList
	 */
	void syncResetReportStatusToV10(String optType, SyncReportStatusToV10Dto toV10Dto, Map<String, String> statusMap, List<AffixDto> affixList);

	/**
	 * 发送签约短信
	 * @param assistantPi
	 * @param customerPremises
	 */
	void sendSignCPSms(PartnerInfo assistantPi, CustomerPremises customerPremises);

	/**
	 *  M2同步置业顾问，成交客户信息
	 * @param reqDto
	 * @param customerPremisesDto
	 */
	void syncM2DealInfo(UpdateSaleStatusReqDto reqDto, CustomerPremisesDto customerPremisesDto);

	void syncExchangeHousesToV10(String optType, SyncReportStatusToV10Dto toV10Dto, Map<String, String> statusMap, List<AffixDto> affixList);


	void syncReportRevisitToV10(SyncReportRevisitToV10Dto toV10Dto,CustomerPremises customerPremises, List<AffixDto> affixList);

}
